home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / batch / tsbat36.zip / PUSHDIRE.BAT < prev    next >
DOS Batch File  |  1991-12-06  |  1KB  |  45 lines

  1. echo off
  2. echo Nonresident pushdir (Stores the current directory name)
  3. echo By Prof. Timo Salmi, ts@chyde.uwasa.fi, Fri 6-Dec-1991
  4. if "%1"=="" echo.
  5.  
  6. rem Saves the current drive and directory names in pushdriv and
  7. rem pushdire environment variables.
  8.  
  9. rem After changing directory, you can pop back to the original
  10. rem drive and directory by applying popdire.bat.
  11.  
  12. rem usage PUSHDIRE [/q]
  13. rem  /q is for quiet, that is the environment variables are not
  14. rem  echoed
  15.  
  16. rem If you get an "Out of environment space" message, increase your
  17. rem environment space by using shell configuration in config.sys:
  18. rem MsDos 3.30 example: shell=c:\bin\command.com /e:1024 /p
  19.  
  20. rem Requires the setpushd.exe program at path
  21. set _found=
  22. if exist setpushd.exe set _found=yes
  23. for %%d in (%path%) do if exist %%d\setpushd.exe set _found=yes
  24. if not "%_found%"=="yes" goto _no_exe
  25.  
  26. rem Let's do it
  27. set _found=
  28. setpushd %1
  29. if errorlevel==1 goto _err
  30. pushd$$$
  31. rem if you have MS-DOS 3.3 you may use the following command instead
  32. rem of pushd$$$: call pushd$$$
  33. goto _out
  34.  
  35. :_err
  36. echo File access error: Failed to push the drive and directory
  37. goto _out
  38.  
  39. :_no_exe
  40. echo SETPUSHD.EXE must be in the present directory or at path.
  41. goto _out
  42.  
  43. :_out
  44. echo on
  45.